﻿// Control20Dlg_2.cpp: 实现文件
//

#include "pch.h"
#include "ProjectAA.h"
#include "Control20Dlg_2.h"
#include "afxdialogex.h"


// CControl20Dlg_2 对话框

IMPLEMENT_DYNAMIC(CControl20Dlg_2, CDialogEx)

CControl20Dlg_2::CControl20Dlg_2(CWnd* pParent /*=nullptr*/)
	: CDialogEx(IDD_DIALOG_CONTROL_20_2, pParent)
{

}

CControl20Dlg_2::~CControl20Dlg_2()
{
}

void CControl20Dlg_2::DoDataExchange(CDataExchange* pDX)
{
	CDialogEx::DoDataExchange(pDX);
}


BEGIN_MESSAGE_MAP(CControl20Dlg_2, CDialogEx)
	ON_BN_CLICKED(IDC_BUTTON6, &CControl20Dlg_2::OnBnClickedButton6)
	ON_BN_CLICKED(IDC_BUTTON4, &CControl20Dlg_2::OnBnClickedButton4)
	ON_BN_CLICKED(IDC_BUTTON5, &CControl20Dlg_2::OnBnClickedButton5)
	ON_BN_CLICKED(IDC_BUTTON2, &CControl20Dlg_2::OnBnClickedButton2)
	ON_BN_CLICKED(IDC_BUTTON3, &CControl20Dlg_2::OnBnClickedButton3)
	ON_BN_CLICKED(IDC_BUTTON27, &CControl20Dlg_2::OnBnClickedButton27)
	ON_BN_CLICKED(IDC_BUTTON28, &CControl20Dlg_2::OnBnClickedButton28)
END_MESSAGE_MAP()


// CControl20Dlg_2 消息处理程序


BOOL CControl20Dlg_2::OnInitDialog()
{
	CDialogEx::OnInitDialog();

	return TRUE;
}


void CControl20Dlg_2::OnBnClickedButton6()
{
	if (gSystemMgr.Y39 == OFF) {
		gSystemMgr.m_cIo.SetOutputIo(39, ON);
	}
	else {
		gSystemMgr.m_cIo.SetOutputIo(39, OFF);
	}
}


void CControl20Dlg_2::OnBnClickedButton4()
{
	gSystemMgr.m_cIo.SetOutputIo(40, ON);
	gSystemMgr.m_cIo.SetOutputIo(41, OFF);
}


void CControl20Dlg_2::OnBnClickedButton5()
{
	gSystemMgr.m_cIo.SetOutputIo(41, ON);
	gSystemMgr.m_cIo.SetOutputIo(40, OFF);
}


void CControl20Dlg_2::OnBnClickedButton2()
{
	gSystemMgr.m_cIo.SetOutputIo(37, ON);
	gSystemMgr.m_cIo.SetOutputIo(38, OFF);
}


void CControl20Dlg_2::OnBnClickedButton3()
{
	gSystemMgr.m_cIo.SetOutputIo(38, ON);
	gSystemMgr.m_cIo.SetOutputIo(37, OFF);
}


void CControl20Dlg_2::OnBnClickedButton27()
{
	if (gSystemMgr.Y52 == OFF) {
		gSystemMgr.m_cIo.SetOutputIo(52, ON);
	}
	else {
		gSystemMgr.m_cIo.SetOutputIo(52, OFF);
	}
}


void CControl20Dlg_2::OnBnClickedButton28()
{
	if (gSystemMgr.Y53 == OFF) {
		gSystemMgr.m_cIo.SetOutputIo(53, ON);
	}
	else {
		gSystemMgr.m_cIo.SetOutputIo(53, OFF);
	}
}
